import java.util.Scanner;

import java.util.List;
import java.util.ArrayList;


public class PrimeTest {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int m = scanner.nextInt();
    int n = scanner.nextInt();
    List<Integer> result = new ArrayList<>();

    for (int i = m; i <= n; i++) {
      if (isPrime(i))
        result.add(i);
    }

    for (int i = 0; i < result.size(); i++) {
      System.out.print(result.get(i));
      System.out.print(i == result.size() - 1 ? "\n" : " ");
    }
  }

  private static boolean isPrime(int number) {
    if (number == 1)
      return false;
    if (number == 2)
      return true;
    if (number % 2 == 0)
      return false;
    for (int i = 3; i * i <= number; i += 2) {
      if (number % i == 0)
        return false;
    }
    return true;
  }
}
